package com.jamy.song.task;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.concurrent.ExecutorService;

public class JamyTask implements Runnable{

    private PreparedStatement ps;

    private Connection conn;

    public JamyTask() {
    }

    public JamyTask(PreparedStatement ps, Connection conn) {
        this.ps = ps;
        this.conn = conn;
    }

    @Override
    public void run() {
        try {
            ps.executeBatch();
            ps.clearBatch();
            conn.commit();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }

    }
}
